﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using DDotNet.ORM.ORMapping.OREntity;

namespace DDotNet.ORM.DataFactory.Interface
{
    /// <summary>
    /// Internal Interface to Get a CRUDHelper
    /// </summary>
    internal interface IHelpeableCRUDFactory
    {
        /// <summary>
        /// Get a Instance of CRUD Helper
        /// </summary>
        /// <returns></returns>
        CRUDHelper GetCRUDHelper();

        /// <summary>
        /// Extract Collection From DataReader
        /// </summary>
        /// <param name="dataReader"></param>
        /// <param name="mappedEntityType"></param>
        /// <returns></returns>
        BusinessCollectionBase<BusinessEntityBase> ExtractCollection(IDataReader dataReader,
                                                                    Type mappedEntityType);

        /// <summary>
        /// Extract Item From DataReader
        /// </summary>
        /// <param name="dataReader"></param>
        /// <param name="mappedEntityType"></param>
        /// <returns></returns>
        BusinessEntityBase ExtractItem(IDataReader dataReader, Type mappedEntityType);
        
        /// <summary>
        /// Extract Entity Links
        /// </summary>
        /// <param name="entity"></param>
        void ExtractLinks(ref BusinessEntityBase entity);
    }
}
